package com.lc.afbx.dialog;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader;
import com.facebook.drawee.view.SimpleDraweeView;
import com.lc.afbx.BaseApplication;
import com.lc.afbx.R;
import com.lc.afbx.util.PictureUtil;

/**
 * Created by Administrator on 2016/11/3.
 */
public class ShowPicDialog extends BaseDialog {


    public ShowPicDialog(Context context, String url) {
        super(context);

        setContentView(R.layout.dialog_show_pic_alert);

        BaseApplication.ScaleScreenHelper.loadView((ViewGroup) findViewById(R.id.dialog_show_ll));

        Bitmap bm = PictureUtil.getSmallBitmap(url);

        SimpleDraweeView dialog_show_pic_iv = (SimpleDraweeView) findViewById(R.id.dialog_show_pic_iv);

        dialog_show_pic_iv.setImageBitmap(bm);


        dialog_show_pic_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                dismiss();

            }
        });

    }

    public ShowPicDialog( String url, Context context) {
        super(context);

        setContentView(R.layout.dialog_show_pic_alert);

        BaseApplication.ScaleScreenHelper.loadView((ViewGroup) findViewById(R.id.dialog_show_ll));

        SimpleDraweeView dialog_show_pic_iv = (SimpleDraweeView) findViewById(R.id.dialog_show_pic_iv);

        dialog_show_pic_iv.setImageURI(Uri.parse(url));


        dialog_show_pic_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                dismiss();

            }
        });

    }


}
